<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
     <style type="text/css">
  .box{
   padding:10px;
  }
  .picBox{
   width:265px;
   height:137px;
   border:1px dashed #999;
  }
  .picBox img{
   width:100%;
   height:100%;
   display:block;
  }
 </style>
</head>
<body>
    <div id="box">
    <!-- <input type="submit" value="异步加载图片" id="submitBtn" /> -->
    <div class="picBox">
        <img data-src="logo.png" src="loading.gif" alt="" class="logo" />
    </div>
</div>
<script type="text/javascript" src="jquery-1.8.3.min.js"></script>
<script>
$(document).ready(function(){
function img(){
  var imgSrc = $(".picBox").find('.logo').attr('data-src');
  console.log(imgSrc);
      $(".picBox").find('.logo').attr('src', imgSrc);
      $(".picBox").find('.logo').removeAttr("data-src");

};
setTimeout(img,2000);
});
</script>
</body>
</html>